package HoneWork2;

import java.util.ArrayList;

import java.util.Arrays;
import java.util.Collection;

public class Test {
    public static void main(String[] args) {
        //定义电影类集合
        Collection<Movie> movies = new ArrayList<>();
        movies.add(new Movie("疯狂的外星人", 9.9, "沈腾"));
        movies.add(new Movie("倚天屠龙记", 8.8, "张艺谋"));
        movies.add(new Movie("我是谁", 8.5, "成龙"));
            //遍历集合,拿到电影信息
        for (Movie movie : movies) {
            System.out.println("电影名:" + movie.getName());
            System.out.println("评分:" + movie.getScore());
            System.out.println("主演:" + movie.getActor());

        }
    }
}


